package ua.kharkov.knure.pereverziev.diploma.db.DAOServices;

public class ServiceFactory {

	private ServiceFactory() {

	}

	static AirportsService airportService;
	static ScheduleService scheduleService;
	static UserService userService;
	static UserRoleService userRoleService;
	static UserStatusService userStatusService;
	static FlightsService flightsService;
	static AdditionalServService additionalServService;
	static TicketService ticketService;

	static ServiceFactory serviceFactory = null;

	public static ServiceFactory getInstance() {
		if (serviceFactory == null) {
			serviceFactory = new ServiceFactory();
		}
		return serviceFactory;
	}

	public AirportsService getAirportService() {
		if (airportService == null) {
			airportService = new AirportsService();
		}
		return airportService;
	}

	public ScheduleService getScheduleService() {
		if (scheduleService == null) {
			scheduleService = new ScheduleService();
		}
		return scheduleService;
	}

	public UserService getUserService() {
		if (userService == null) {
			userService = new UserService();
		}
		return userService;
	}

	public UserRoleService getUserRoleService() {
		if (userRoleService == null) {
			userRoleService = new UserRoleService();
		}
		return userRoleService;
	}

	public UserStatusService getUserStatusService() {
		if (userStatusService == null) {
			userStatusService = new UserStatusService();
		}
		return userStatusService;
	}

	public FlightsService getFlightsService() {
		if (flightsService == null) {
			flightsService = new FlightsService();
		}
		return flightsService;
	}

	public AdditionalServService getAdditionalServService() {
		if (additionalServService == null) {
			additionalServService = new AdditionalServService();
		}
		return additionalServService;
	}

	public TicketService getTicketService() {
		if (ticketService == null) {
			ticketService = new TicketService();
		}
		return ticketService;
	}
}
